{include file="public/header" /}
</head>
<body>
<div id="box" v-cloak class="box">
	<el-form>
		<el-form-item label="标签名称">
			<el-input placeholder="请输入标签名称" v-model="name"></el-input>
		</el-form-item>
		<el-form-item>
			<el-button type="primary" style="width:100%;" @click="submit();">立即提交</el-button>
		</el-form-item>
	</el-form>
</div>
<script>
new Vue({
	el : '#box',
	data:{
		name : ''
	},
	mounted:function(){},
	methods:{
		submit:function(){
			if(!this.name)return toastError(parent.vm,'名称不能为空');
			$.post('{:url("addBadge")}',{name:this.name},function(res){
				if(res.code) {
					toastSuccess(parent.vm,res.msg,function(){
						parent.location.reload();
					});
				}else{
					toastError(parent.vm,res.msg);
				}
			});
		},
	}
});
</script>
</body>
</html>